<?php
/* @var $this TuanController */

?>

<div class="tuan_pro">
	<div class="tuan_categ_filter bg_fff">
		<dl class="c_f">
			<dt class="bg">分类</dt>
			<?php foreach(ProTuan::model()->getCateStat() as $key=>$val){?>
			<dd class="<?php echo ($model->category_top==$key)?'cur':'' ?>">
				<?php echo CHtml::link(CHtml::encode($val['title']).'('.$val['stat'].')',array('index','cat'=>$key,'pri'=>$model->priceInterval,'ord'=>$model->list_order))?>
			</dd>
			<?php }?>
		</dl>
		<dl class="c_f">
			<dt class="bg">价格</dt>
			<?php foreach(ProTuan::model()->getPriceStat() as $key=>$val){?>
			<dd class="<?php echo ($model->priceInterval==$key)?'cur':'' ?>">
				<?php echo CHtml::link(CHtml::encode($val['title']).'('.$val['stat'].')',array('index','cat'=>$model->category_top,'pri'=>$key,'ord'=>$model->list_order))?>
			</dd>
			<?php }?>
		</dl>
	</div>
	<div class="hr_08"></div>
	<?php   
		$this->widget('zii.widgets.CListView', array(  
		    'dataProvider'=>$model->search(9),  
		    'itemView'=>'_view',    
		    'emptyText'=>'暂时没有数据',  
		    'pager'=>array('class'=>'CLinksPager'),
			'cssFile'=>'/css/yii-list-view/styles_h.css',
			'htmlOptions'=>array('class'=>'list-view tuan_list list_hover'),
			'itemsTagName'=>'ul',
			'summaryText'=>'第 {start}-{end} 条, 共<strong class="c_red2">{count}</strong> 条   第{page}页/共{pages}页',
			'pagerTemplate'=>'onlyPager',
			'buttonCssClass'=>'bg_x btn_page',
			'batchItemOptions'=>array('class'=>"f_l filter_tool "),
		    'batchItem'=>array(  
		        //移动到分类  
		        '<span class="c_666">排序：</span>',  
		        //添加到分类  
		        CHtml::link('默认',array('index','cat'=>$model->category_top,'pri'=>$model->priceInterval,'ord'=>''),array('class'=>'default b_d')),
				CHtml::link('价格'.'<b class="ico ico_up"></b>',array('index','cat'=>$model->category_top,'pri'=>$model->priceInterval,'ord'=>'1'),array('class'=>'bg_x b_d')),
				CHtml::link('价格'.'<b class="ico ico_down"></b>',array('index','cat'=>$model->category_top,'pri'=>$model->priceInterval,'ord'=>'2'),array('class'=>'bg_x b_d')),  
		   		CHtml::link('销量'.'<b class="ico ico_up"></b>',array('index','cat'=>$model->category_top,'pri'=>$model->priceInterval,'ord'=>'3'),array('class'=>'bg_x b_d')),
				CHtml::link('销量'.'<b class="ico ico_down"></b>',array('index','cat'=>$model->category_top,'pri'=>$model->priceInterval,'ord'=>'4'),array('class'=>'bg_x b_d')),
				CHtml::link('折扣'.'<b class="ico ico_up"></b>',array('index','cat'=>$model->category_top,'pri'=>$model->priceInterval,'ord'=>'5'),array('class'=>'bg_x b_d')),
			 ),  
		    ));  
	?>  
<div class="hr_15"></div>
<div class="tuan_recommand bg_fff">
	<div class="hd"><h2 class="fs_14">热团推荐</h2></div>
	<div class="bd">
		<ul class="c_f">
			<!-- 推荐位-热团推荐 -->
			<?php 
			$positdata = Positions::model()->getPosData('10');
			if (!empty($positdata)){foreach($positdata as $data){
			?>
			<li class="item">
				<div class="c_img">
					<?php echo CHtml::link(Tool::thumb($data->zpl_pic,160,106,$data->zpl_title),array('detail','id'=>$data->zpl_content_id))?>
				</div>
				<?php $product = ProTuan::model()->findByAttributes(array('zpt_id'=>$data->zpl_content_id)); ?>
				<p class="price ff_yh">
					<strong class="f_r c_red2 fs_14">&yen;<?php echo $product->zpt_price ?></strong>
					<del class="c_999">&yen;<?php echo $product->zpt_saleprice ?></del>
				</p>
				<p class="title title_pro t_c">
					<?php echo CHtml::link(mb_substr($data->zpl_title,0,22,'utf8'),array('detail','id'=>$data->zpl_content_id))?>
				</p>
			</li>
            <?php }} else {?>
                 <p style="text-align:center">没有找到相关促销产品!</p>
            <?php } ?>
		</ul>
	</div>
</div>        

<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/style/style_tuan.css" rel="stylesheet" type="text/css" />
